*2nd prime validation experiment, mturk only
clear
set more off
insheet using "/Users/gwf25/Dropbox/research/religion/final code/mturk 2nd validation.txt"
drop if v1 == "ResponseID"
gen treatR = .
replace treatR = 1 if q5 ~= ""
replace treatR = 0 if q7 ~= ""
tab treatR
drop if religion == .

*by religion
*q19 asks about religion
*1 = christian-protestant
*2 = christian-catholic
*3 = christian other
*4 = jewish
*5 = muslim
*6 = buddhist
*7 = hindu
*8 = agnostic
*9 = atheist
*10 = other
rename q19 religi
gen relig = "5"
replace relig = "1" if religi == "1"
replace relig = "2" if religi == "2"
replace relig = "3" if religi == "3"
replace relig = "4" if religi == "4"
replace relig = "8" if religi == "8"
replace relig = "9" if religi == "9"

*drop those who aren't protestant in the other christian category
replace relig = "5" if relig == "3" & q20 == "witness"
replace relig = "5" if relig == "3" & q20 == "Unity"
replace relig = "5" if relig == "3" & q20 == "The Church of Jesus Christ of Latter-Day Saints"
replace relig = "5" if relig == "3" & q20 == "The Church of Jesus Christ of Latter-Day Saints"
replace relig = "5" if relig == "3" & q20 == "The Church of Jesus Christ of Latter Day Saints"
replace relig = "5" if relig == "3" & q20 == "The Church of Jesus Christ of Latter Day Saints"
replace relig = "5" if relig == "3" & q20 == "progressive christian"
replace relig = "5" if relig == "3" & q20 == "Orthodox Christian"
replace relig = "5" if relig == "3" & q20 == "Orthodox"
replace relig = "5" if relig == "3" & q20 == "Orthodox"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "Mormon"
replace relig = "5" if relig == "3" & q20 == "LDS"
replace relig = "5" if relig == "3" & q20 == "LDS"
replace relig = "5" if relig == "3" & q20 == "LDS"
replace relig = "5" if relig == "3" & q20 == "LDS"
replace relig = "5" if relig == "3" & q20 == "Latter-day Saint"
replace relig = "5" if relig == "3" & q20 == "Latter Day Saint (Mormon)"
replace relig = "5" if relig == "3" & q20 == "Latter Day Saint"
replace relig = "5" if relig == "3" & q20 == "Jehovahs witness"
replace relig = "5" if relig == "3" & q20 == "Jehovah's Witnesses"
replace relig = "5" if relig == "3" & q20 == "Jehovah's Witness"
replace relig = "5" if relig == "3" & q20 == "Jehovah witness"
replace relig = "5" if relig == "3" & q20 == "Greek Orthodox"
replace relig = "5" if relig == "3" & q20 == "Eastern Orthodox"
replace relig = "5" if relig == "3" & q20 == "Church of Jesus Christ of Latter-Day Saints (LDS)"
replace relig = "5" if relig == "3" & q20 == "Christian- Orthodox"
replace relig = "5" if relig == "3" & q20 == "Christian Science"
replace relig = "5" if relig == "3" & q20 == "Black Hebrew"

replace relig = "1" if relig == "1"
replace relig = "2" if relig == "2"
replace relig = "1" if relig == "3"
replace relig = "4" if relig == "4"
replace relig = "8" if relig == "8"
replace relig = "8" if relig == "9"

count if treatR == 0 & (relig == "1" | relig == "3")
count if treatR == 1 & (relig == "1" | relig == "3")
count if treatR == 0 & relig == "2"
count if treatR == 1 & relig == "2"
count if treatR == 0 & relig == "4"
count if treatR == 1 & relig == "4"
count if treatR == 0 & (relig == "8" | relig == "9")
count if treatR == 1 & (relig == "8" | relig == "9")

tabulate treatR relig, chi2

count if treatR == 0 //905
count if treatR == 1 //883

count if treatR == 0 & religion == 1 //253
count if treatR == 1 & religion == 1 //248

di 253/905 //.280
di 248/883 //.281

prtesti 905 .280 883 .281



*difference in religious identification by treatment in validation sample
clear
set more off
insheet using "/Users/gwf25/Dropbox/research/religion/final code/OnlineQuests.txt"
drop if v1 == "ResponseID"
gen treatR = .
replace treatR = 1 if q5 ~= ""
replace treatR = 0 if q7 ~= ""
tab treatR

drop if classification1_1 == "" & id ~= 215

drop if treatR == .
count if treatR == 1
count if treatR == 0


tab classification1_1
replace classification1_1 = "Political orientation" if classification1_1 == "Political Orientation"
tab classification1_2
tab classification1_3

tab classification2_1
tab classification2_2
tab classification2_3

tab classification3_1
replace classification3_1 = "Sexual orientation" if classification3_1 == "sexual orientation"
tab classification3_2
tab classification3_3

tab classification4_1
replace classification4_1 = "Other" if classification4_1 == "other"
tab classification4_2
tab classification4_3

tab classification5_1
tab classification5_2
tab classification5_3

***RESULTS***

*RELIGION
generate religion = 0
replace religion = 1 if classification1_1 == "Religion, morality, and philosophy"
replace religion = 1 if classification1_2 == "Religion, morality, and philosophy"
replace religion = 1 if classification2_1 == "Religion, morality, and philosophy" 
replace religion = 1 if classification2_2 == "Religion, morality, and philosophy" 
replace religion = 1 if classification2_3 == "Religion, morality, and philosophy" 
replace religion = 1 if classification3_1 == "Religion, morality, and philosophy" 
replace religion = 1 if classification3_2 == "Religion, morality, and philosophy" 
replace religion = 1 if classification3_3 == "Religion, morality, and philosophy" 
replace religion = 1 if classification4_1 == "Religion, morality, and philosophy" 
replace religion = 1 if classification4_2 == "Religion, morality, and philosophy" 
replace religion = 1 if classification4_3 == "Religion, morality, and philosophy" 
replace religion = 1 if classification5_1 == "Religion, morality, and philosophy" 
replace religion = 1 if classification5_2 == "Religion, morality, and philosophy"

*by religion
*q19 asks about religion
*1 = christian-protestant
*2 = christian-catholic
*3 = christian other
*4 = jewish
*5 = muslim
*6 = buddhist
*7 = hindu
*8 = agnostic
*9 = atheist
*10 = other
rename q19 relig
*drop those who aren't protestant in the other christian category
replace relig = "." if relig == "3" & q20 == "Christian-Orthodox"
replace relig = "." if relig == "3" & q20 == "my business"
replace relig = "." if relig == "3" & q20 == "orthodoxy"
replace relig = "." if relig == "3" & q20 == "LDS/Mormon"
replace relig = "." if relig == "3" & q20 == "Jehovah's Witness :)"
replace relig = "." if relig == "3" & q20 == "Orthodox"
replace relig = "." if relig == "3" & q20 == "I don't affiliate with any church"
replace relig = "." if relig == "3" & q20 == "Jehovah's Witness"
replace relig = "." if relig == "3" & q20 == "I see myself as a Christian however I draw spiritual inspiration from many religious traditions"
replace relig = "." if relig == "3" & q20 == "Unity School of Christianity"
replace relig = "." if relig == "3" & q20 == "Greek Orthodox"
replace relig = "." if relig == "3" & q20 == "Spiritual"
replace relig = "." if relig == "3" & q20 == "independent"
replace relig = "." if relig == "3" & q20 == "none"
replace relig = "." if relig == "3" & q20 == "unity/new age"
replace relig = "." if relig == "3" & q20 == "afro-christian called UMBANDA"
replace relig = "." if relig == "3" & q20 == "no group or religion"
replace relig = "." if relig == "3" & q20 == "LDS"
replace relig = "." if relig == "3" & q20 == "Christian nature lover"
replace relig = "." if relig == "3" & q20 == "Believer but not praticing"
replace relig = "." if relig == "3" & q20 == "Spirtulist"
replace relig = "." if relig == "3" & q20 == "Greek Orthodox"
replace relig = "." if relig == "3" & q20 == "Kardecist Spiritism"
replace relig = "." if relig == "3" & q20 == "latter-day saint (Mormon)"
replace relig = "." if relig == "3" & q20 == "Coptic, Orthodox"
replace relig = "." if relig == "3" & q20 == "I believe in God, and I pray but I don't follow any kind of organized church, nor do I profess my beliefs."
replace relig = "." if relig == "3" & q20 == "Jehovah's Witness"
replace relig = "." if relig == "3" & q20 == "Greek Orthodox"
replace relig = "." if relig == "3" & q20 == "Orthdox"
replace relig = "." if relig == "3" & q20 == "lds"
replace relig = "." if relig == "3" & q20 == "Messianic Judiasm"
replace relig = "." if relig == "3" & q20 == "I am Orthodox Christian"
replace relig = "." if relig == "3" & q20 == "Coptic Orthodox Christian"
replace relig = "." if relig == "3" & q20 == "not very religious"
replace relig = "." if relig == "3" & q20 == "latter day saints"
replace relig = "." if relig == "3" & q20 == "LDS"
replace relig = "." if relig == "3" & q20 == "Orthodox"
replace relig = "." if relig == "3" & q20 == "Latter Day Saint"
replace relig = "." if relig == "3" & q20 == "Jehovah's Witness"
replace relig = "." if relig == "3" & q20 == "I love jesus and god but religion is a scam and has not contributed anything to humanity."
replace relig = "." if relig == "3" & q20 == "LDS"
replace relig = "." if relig == "3" & q20 == "Jehovah's Witnesses"
replace relig = "." if relig == "3" & q20 == "Jehovah's Witness"
replace relig = "." if relig == "3" & q20 == "Jehovah's Witnesses"
replace relig = "." if relig == "3" & q20 == "The Church of Jesus Christ of Latter-day Saints"

count if treatR == 1 //895
count if treatR == 0 //903

count if treatR == 1 & relig == "2" //138
count if treatR == 0 & relig == "2" //176

di 138/895 //.154
di 176/903 //.195

count if treatR == 1 & (relig == "1" | relig == "3") //271
count if treatR == 0 & (relig == "1" | relig == "3") //239

di 271/895 //.303
di 239/903 //.265

*frequency of christians by treatment and calculation of bounds on effect
count if treatR == 1 & (relig == "1" | relig == "3" | relig == "2") //409
count if treatR == 0 & (relig == "1" | relig == "3" | relig == "2") //415

di 409/895 //.457
di 415/903 //.460

count if treatR == 1 & relig == "2" //138
count if treatR == 0 & relig == "2" //176

di 138/409 // .337
di 176/415 // .424

count if treatR == 1 & relig == "2" & religion == 1 //46
di 46/409 //.112

count if treatR == 0 & relig == "2" & religion == 1 //46
count if treatR == 0 & relig == "2" //176
di 46/176 //.261

count if treatR == 1 & (relig == "1" | relig == "3") & religion == 1 //129
di 129/409 //.315

count if treatR == 0 & (relig == "1" | relig == "3") & religion == 1 //98
di 98/239 //.410
